package com.lsk.api;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.lsk.util.MD5;

public class ApiReturn {
    /**
     * 根据code获取对应消息
     * @param code
     * @param type '0 易缴费 1 闲卡网 3 收卡啦'  4速销卡
     * @return
     */
    public static String getMsgByCode(String code,String type){

        String result="类型"+type+":未匹配到对应消息";

        String sql="SELECT *from api_returnconfig where type='"+type
                +"' and `code`='"+code+"'";

        Record record= Db.findFirstByCache("blockIp",MD5.md5(sql),sql);

        if (record!=null){

            result=record.getStr("msg");
        }
        return result;

    }

}
